import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
import login from '@/views/wzj/logIn.vue'
import register from '@/views/wzj/register.vue'
import myHome from '@/views/wzj/myHome.vue'
 


import sl from '../router/sl'
import lwj from '../router/lwj'
import yxd from '../router/yxd'
import ykx from '../router/ykx'
import wzj from '../router/wzj'



const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children:[...sl,...lwj,...wzj,...yxd,...ykx],
    redirect:{name:'myHome'},
  },
  {
    path:'/login',
    name:'login',
    component:login, 
  },
  {
    path:'/register',
    name:'register',
    component:register,
  }
  ,
  {
    path:'/myHome',
    name:'myHome',
    component:myHome,
  }
]
// const route = [...routes,...sl]

// 配置哈西路由
const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes

    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue')
    // }

})

export default router
